﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPages/Site.Master" AutoEventWireup="true" CodeBehind="Users.aspx.cs" Inherits="Legazpi.Payroll.Web.Admin.Users" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
        <script src="../Scripts/Accounts/Users.js" type="text/javascript"></script>

        <script language="javascript" type="text/javascript">
            $(document).ready(function () {
                $('#Userstbl').dataTable({
                    "bJQueryUI": true,
                    'sPaginationType': 'full_numbers',
                    'iDisplayLength': 50,
                    "bPaginate": true,
                    "bProcessing": true,
                    "aoColumns": [
                        null, //id
                        null, //Username
                        null, //Password
                        null, //Email                        
                        {"sWidth": "25%", "bSortable": false}], //buttons
                    "bServerSide": false
                });
            });
        </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
        <h2>
            Users Table
        </h2>
        <hr /><br />
        <input type="button" id="btnAddUser" value="Add New" />
        <table width="100%">
            <tr>
                <td width="75%" valign="top">
                    <asp:Repeater ID="repeater" runat="server">
                        <HeaderTemplate>
                            <table id="Userstbl" cellpadding="1" cellspacing="0" 
                                border="0" class="display">
                              <thead>
                                <tr>
                                    <th align="left">Id</th>
                                    <th align="left">Username</th>
                                    <th align="left">Password</th>
                                    <th align="left">Email</th>
                                    <th align="left"></th>
                                </tr>
                              </thead>
                            <tbody>
                        </HeaderTemplate>
                        <ItemTemplate>
                            <tr>
                              <td><%# Eval("Id") %></td>
                              <td><%# Eval("UserName")%></td>
                              <td><%# Eval("Password")%></td>
                              <td><%# Eval("Email")%></td>
                              <td>
                                <input type="button" value="Update" class="btnUdpate" data-id="<%# Eval("Id") %>" />
                                <input type="button" value="Delete" class="btnDelete" data-id="<%# Eval("Id") %>" />
                              </td>
                            </tr>
                        </ItemTemplate>
                        <FooterTemplate>
                                </tbody>
                            </table>
                        </FooterTemplate>
                    </asp:Repeater>                    
                </td>
                <td valign="top">
                    <div id="UserForm" style="display:none;">
                        <input type="hidden" id="UserId" value="0" />
                        <fieldset class="register">
                            <legend>User Details</legend>
                            <p>
                                <label for="Username">Username:</label>
                                <input type="text" id="Username" CssClass="textEntry" />
                            </p>
                            <p>
                                <label for="Password">Password:</label>
                                <input type="password" id="Password" CssClass="textEntry" />
                            </p>
                            <p>
                                <label for="Email">Email:</label>
                                <input type="text" id="Email" CssClass="textEntry" />
                            </p>
                        </fieldset>
                        <p class="submitButton">
                            <input type="button" id="UserSubmitButton" value="Submit" />
                        </p>   
                    </div>                                     
                </td>
            </tr>
        </table>
    
</asp:Content>
